package util;

import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;

/**
 * 
 * @author 李东喜
 * 2009-7-13
 */
public class IOUtils extends org.apache.commons.io.IOUtils {
    
    public IOUtils() {
        super();
    }
    
    /**
     * 关闭字节输入流
     * @param iss
     */
    public static void close(InputStream... iss) {
        if (null != iss && 0 < iss.length) {
            for (InputStream is : iss) {
                closeQuietly(is);
            }
        }
    }
    
    /**
     * 关闭字节输出流
     * @param oss
     */
    public static void close(OutputStream... oss) {
        if (null != oss && 0 < oss.length) {
            for (OutputStream os : oss) {
                closeQuietly(os);
            }
        }
    }
    
    /**
     * 关闭字符输入流
     * @param readers
     */
    public static void close(Reader... readers) {
        if (null != readers && 0 < readers.length) {
            for (Reader reader : readers) {
                closeQuietly(reader);
            }
        }
    }
    
    /**
     * 关闭字符输出流
     * @param writers
     */
    public static void close(Writer... writers) {
        if (null != writers && 0 < writers.length) {
            for (Writer writer : writers) {
                closeQuietly(writer);
            }
        }
    }

}
